/*
**  Apache License, Version 2.0
**  Notes:Use this command to anonymously check out the latest project source code:
**  Non-members may check out a read-only working copy anonymously over HTTP.
**  SVN checkout http://YHHCatiaBaseUtlWsp.googlecode.com/svn/trunk/ 
**
**  Author:		Kevin Yang
**  Email:		Bigearrabbit@qq.com
**
**  DATE:		2013-4-4
**
**  File Name:	YHHDialogFunctions.cpp
**
**  Notes:
** 
*/
#include "YHHDialogFunctions.h"
namespace YHH
{
	//---------------------------------------------------------
	void CATDlgSelectorListSetLine(CATDlgSelectorList* ipSelectorList,
		CATISpecObject_var ispInput,const CATUnicodeString * ipNoSelectionMsg/* = NULL*/)
	{
		if (!ipSelectorList)return ;//check pointer

		ipSelectorList->ClearLine();//clear First
		if (NULL_var == ispInput)
		{
			if (ipNoSelectionMsg)
			{
				ipSelectorList->SetLine(*ipNoSelectionMsg,0,CATDlgDataModify);//Set infor
			}
			else
			{
				CATUnicodeString	NoSelectionMsg ="(No Selection)";//no sel msg
				ipSelectorList->SetLine(NoSelectionMsg,0,CATDlgDataModify);//Set infor
			}
		}
		else
		{
			ipSelectorList->SetLine(ispInput->GetDisplayName(),0,CATDlgDataModify);//Set infor
		}
	}
	//---------------------------------------------------------
	void CATDlgSelectorListSetLine(CATDlgSelectorList* ipSelectorList,
		CATListValCATISpecObject_var ispListInput,const CATUnicodeString * ipNoSelectionMsg/* = NULL*/)
	{
		if (!ipSelectorList)return ;//check pointer

		ipSelectorList->ClearLine();//clear First
		if (ispListInput.Size() == 0)
		{
			if (ipNoSelectionMsg)
			{
				ipSelectorList->SetLine(*ipNoSelectionMsg,0,CATDlgDataModify);//Set infor
			}
			else
			{
				CATUnicodeString	NoSelectionMsg ="(No Selection)";//no sel msg
				ipSelectorList->SetLine(NoSelectionMsg,0,CATDlgDataModify);//Set infor
			}
		}
		else
		{
			const int size = ispListInput.Size();//size of list
			for (int i=1;i<=size;i++)//loop i
			{
				ipSelectorList->SetLine(ispListInput[i]->GetDisplayName(),i-1,CATDlgDataModify);//Set infor
			}
		}
	}

}
//-----------------------------------------------------------------------------
YHHDialogFunctions::YHHDialogFunctions()
{
}
//-----------------------------------------------------------------------------
YHHDialogFunctions::~YHHDialogFunctions()
{
}
//-----------------------------------------------------------------------------
YHHDialogFunctions::YHHDialogFunctions(YHHDialogFunctions& original)
{
}
//-----------------------------------------------------------------------------
YHHDialogFunctions& YHHDialogFunctions::operator=(YHHDialogFunctions& original)
{
   return *this;
}
 
